package menu_router

import (
	"benkendSystem/api/menu_api"
	"benkendSystem/middleware"
	"github.com/gin-gonic/gin"
)

// MenuRouter 菜单路由
func MenuRouter(r *gin.RouterGroup) {
	menu := r.Group("/menu").Use(middleware.LoginAuthCheck())
	{
		menu.POST("/add", middleware.CheckMenu("addMenu"), menu_api.AddMenu)
		menu.POST("/get", middleware.CheckMenu("getMenu"), menu_api.GetMenuList)
		menu.POST("/update", middleware.CheckMenu("updateMenu"), menu_api.UpdateMenu)
		menu.POST("/delete", middleware.CheckMenu("deleteMenu"), menu_api.DeleteMenu)
		menu.POST("/addmenufromrole", middleware.CheckMenu("addMenuForRole"), menu_api.AddMenuForRole)
		menu.POST("/getmenufromrole", middleware.CheckMenu("getMenuFromRole"), menu_api.GetMenuFromRole)
	}
}
